<template>
  <div class="commission">
    <ContentBox title="佣金明细" @left="back" :fixed="true" :ostyle="style" titlecolor="block">
      <template slot="oleft"><van-icon color="#000" name="arrow-left"/></template>
    </ContentBox>
    <notice :top="$remToPx('0.88')"></notice>
    <div class="promoterHeader">
      <div class="headerCon acea-row row-between-wrapper" :style="{backgroundImage:`url(${$img('transparent.png')})`}">
        <div>
          <div class="name">提现记录</div>
          <div class="money">
            ￥<span class="num">{{mData.extractCount}}</span>
          </div>
        </div>
        <div class="price" :style="{backgroundImage:`url(${$img('money_big.png')})`}"></div>
      </div>
    </div>
    <div class="sign-record">
      <div class="list">
        <div class="item" v-for="(item, index) in listData" :key="index">
          <div class="data">{{item.time}}</div>
          <div class="listn" v-for="(item1, index1) in item.list" :key="index1">
            <div class="itemn acea-row row-between-wrapper">
              <div>
                <div class="name line1">{{item1.title}}</div>
                <div>{{item1.add_time}}</div>
              </div>
              <div class="num" v-if="num == 1">{{item1.pm === 0 ? '-' : '+'}}{{item1.number}}</div>
              <div class="num font-color-red" v-else>-1</div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data () {
    return {
      style: {
        backgroundColor: '#f6f6f6'
      },
      num: 1,
      mData: '',
      listData: ''
    }
  },
  methods: {
    back () {
      this.$router.go(-1)
    },
    getData () {
      this.$axios.get('/api/commission').then(res => {
        if (res.status === 200) {
          this.mData = res.data
        }
      })
    },
    getList () {
      this.$axios.get(`/api/spread/commission/${0}`).then(res => {
        if (res.status === 200) {
          this.listData = res.data
        }
      })
    }
  },
  created () {
    this.getData()
    this.getList()
  }
}
</script>

<style lang="scss" scoped>
@import './index.scss';
</style>
